import Vue from 'vue'
import VueRouter from 'vue-router'
import login_BG from "../views/login_BG.vue"
import admin_BG from "../views/admin_BG.vue"
import login from "../views/login/Login.vue"
//这个是博客管理的目录
import insert_blog from '../views/admin/manage_blog/insert_blog.vue'
import show_blog from "../views/admin/manage_blog/show_blog.vue"
import manage_tags from "../views/admin/manage_blog/manage_tags.vue"
import manage_type from "../views/admin/manage_blog/manage_type.vue"
//查看博客的详情
import show_blog_aritle from "../views/admin/manage_blog/show_blog_article.vue"
//对博客的内容进行修改
import update_blog_article from "../views/admin/manage_blog/update_blog_article.vue"

//个人中心目录
import message_manage from "../views/admin/infomation/message_manage.vue"
import mysels_information from "../views/admin/infomation/myself_infomation.vue"
import friend from "../views/admin/infomation/friend.vue"

//这个是数据统计目录
import show_blog_data from "../views/admin/data_show/show_blog_data.vue"

//后台登录用户管理
import add_user from "../views/admin/user_manage/add_user.vue"
import show_user from "../views/admin/user_manage/show_user.vue"

Vue.use(VueRouter)

const routes = [
  {
  	  path:'/',
  	  name:'登录背景',
  	  component:login_BG,
	  redirect:'/login',
	  children:[
		  {
		  path:'/login',
		  name:'登录界面',
		  component:login
		  },
	  ]
  },
  {
	path:'/admin',
	name:'博客背景',
	component:admin_BG,
	children:[
		//个人中心
		{
		path:'/mysels_information',
		name:'个人中心',
		component:mysels_information,
		//这里的requireAuth为true 表示需要进行路由判断!!!!!
		meta:{requireAuth:true},
		},
		{
		path:'/message_manage',
		name:'留言管理',
		component:message_manage,
		meta:{requireAuth:true},
		},
		{
		path:'/friend',
		name:'友链管理',
		component:friend,
		meta:{requireAuth:true},
		},
		//博客管理页面路由配置
		{
		path:'/insert_blog',
		name:'增加博客界面',
		component:insert_blog,
		meta:{requireAuth:true},
		},
		{
		path:'/show_blog',
		name:'查看博文',
		component:show_blog,
		meta:{requireAuth:true},
		},
		{
		path:'/show_blog_aritle',
		name:'查看博文详情',
		component:show_blog_aritle,
		meta:{requireAuth:true},
		},
		{
		path:'/update_blog_article',
		name:'修改博文',
		component:update_blog_article,
		meta:{requireAuth:true},
		},
		{
		path:'/manage_tags',
		name:'管理标签',
		component:manage_tags,
		meta:{requireAuth:true},
		},
		{
		path:'/manage_type',
		name:'管理类别',
		component:manage_type,
		meta:{requireAuth:true},
		},
		//数据统计
		{
		path:'/show_blog_data',
		name:'博文数据',
		component:show_blog_data,
		meta:{requireAuth:true},
		},
		//登录用户管理
		{
		path:'/add_user',
		name:'添加登录用户',
		component:add_user,
		meta:{requireAuth:true},
		},
		{
		path:'/show_user',
		name:'查看登录用户',
		component:show_user,
		meta:{requireAuth:true},
		},
	]  
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
